Error Handling
In case an error occurs during document processing or when executing an action, corresponding errors objects are stored in place of the expected action result. Each type of action error follows the same schema.
Format of a Failed Action
If an action fails, the ProcessingResult<T>
will have IsSuccess
set to false
and will include an Error object
instead of the expected result.
For example:
{
"isSuccess": false,
"result": null,
"error": {
"errorType": "UnexpectedError",
"message": "The given key 'statusCode' was not present in the dictionary."
}
}
Format of an Action in Progress
When a request is being processed, the statusCode
is set to 202 – Accepted
, and the following response is displayed:
{
"id": "9984baa7-9948-4c03-bc06-313dd858c5ac",
"timestamp": "2025-06-04T16:18:34.2353763+00:00",
"status": "PROCESSING",
"inProgress": true
}
The following is an example of a GET
result:
{
"id": "156e4a8a-e9c8-41c0-95f0-7039982236f3",
"timestamp": "2025-03-24T15:45:14.104323+01:00",
"results": [
{
"objectKey": "testing/documents/fedex.pdf",
"imageDescription": null,
"metadata": null,
"textSummary": {
"isSuccess": false,
"result": null,
"error": {
"errorType": "UnexpectedError",
"message": "The given key 'statusCode' was not present in the dictionary."
}
},
"textClassification": {
"isSuccess": true,
"result": "invoice",
"error": null
},
"imageClassification": null,
"textEmbeddings": null,
"imageEmbeddings": null,
"generalProcessingErrors": null,
"namedEntityText": null,
"namedEntityImage": null
}
],
"status": "PARTIAL_FAILURE"
}